
package com.kugou.game.sdk.statistics;

import com.kugou.framework.http.RequestPackage;
import com.kugou.framework.utils.UrlEncodeUtil;
import com.kugou.game.sdk.utils.UrlWrapper;

import android.content.Context;

import java.util.HashMap;

public class StatPatchLogTask extends AbsStatisticsTask {

    private String errorLog;

    private int optype;

    private int patchId;

    public StatPatchLogTask(Context context, int optype, int patchId, String errorLog) {
        super(context);
        this.optype = optype;
        this.patchId = patchId;
        this.errorLog = errorLog;
    }

    @Override
    public void initParams(HashMap<String, String> params) {
        params.put("statid", StatCmd.CMD_PATCH_LOG + "");
        params.put("optype", optype + "");
        params.put("id", patchId + "");
        params.put("errorlog", UrlEncodeUtil.encode(errorLog, "utf-8"));
    }

    @Override
    public int getRequestType() {
        return RequestPackage.TYPE_POST;
    }

    @Override
    public String getUrl() {
        return UrlWrapper.STATICS_ONLINE_POST_URL + getCommonParams();
    }

}
